// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-6-4

#ifndef __MD5_H_NETMSG__
#define __MD5_H_NETMSG__

#pragma once

#include <windows.h>

//##ModelId=44CF17B101BA
class CJoyMD5
{
public:
    // These four values must be contiguous, and in this order
    union
    {
        ULONG       m_state[4];
        struct
        {
            ULONG       m_a;              // state 
            ULONG       m_b;              //     ... variables
            ULONG       m_c;              //            ... as found in
            ULONG       m_d;              //                    ... RFC1321
        } u;
    };
    
	//##ModelId=44CF17B101C5
    BYTE        m_data[64];       // where to accumulate the data as we are passed it
	//##ModelId=44CF17B101C6
    size_t      m_cbitHashed;     // amount of data that we've hashed
	//##ModelId=44CF17B101C7
    size_t      m_cbData;         // number of bytes presently in data
    
	//##ModelId=44CF17B101C8
    BYTE        m_padding[64];    // padding data, used if length data not = 0 mod 64
public:
	//##ModelId=44CF17B101C9
    CJoyMD5();
	//##ModelId=44CF17B101D4
    virtual ~CJoyMD5();

	//##ModelId=44CF17B101D6
    virtual size_t GetDataSize();
	//##ModelId=44CF17B101D8
    virtual const BYTE* GetHashValue();
	//##ModelId=44CF17B101DA
    virtual UINT GetHashSize();
	//##ModelId=44CF17B101E4
    virtual void Update(const void* data, size_t s);
	//##ModelId=44CF17B101E8
    virtual void Clear();
};


#endif  // __MD5_H_NETMSG__
